//TODO:2 missing atoms: colormap and wm2_running!!
//TODO:why does this program call atoms WM_1,WM_2...

#include "cmanagerapp.h"
#include "croot.h"

#include <buola/gui/x11/ccomposite.h>
#include <buola/gui/x11/crandr.h>
#include <buola/gui/x11/cfixes.h>
#include <buola/gui/x11/cxrender.h>
#include <buola/gui/x11/cx11display.h>
#include <buola/gui/ctoolkit.h>
#include <buola/gui/cphysicalwindow.h>

namespace buola { namespace bwm {

CManagerApp::CManagerApp()
{
}

void CManagerApp::CheckExtensions()
{
    gui::x11::CXRender::InitExtension();
    gui::x11::CComposite::InitExtension();
    gui::x11::CRandR::InitExtension();
    gui::x11::CFixes::InitExtension();
}

/*
gui::CWindow *CManagerApp::Get(gui::x11::CX11Window *pWindow)
{
    if(pWindow->IsRoot())
    {
        gRoot=new CRoot;
        msg_info() << "ccc\n";
        gRoot->Create(this,pWindow);
        msg_info() << "ddd\n";
        
        return gRoot;
    }
    else
    {
        return CWindowFactory::Get(pWindow);
    }
}
*/

bool CManagerApp::Start()
{
    CApp::Start();
    CheckExtensions();
    gRoot=new CRoot;
    return true;
}

CManagerApp::~CManagerApp()
{
}

/*namespace bwm*/ } /*namespace buola*/ }
